package com.cashmate.struts;

import com.cashmate.hibernate.dao.UsertypeEmployeeDAO;
import com.cashmate.hibernate.pojo.Employees;
import com.cashmate.hibernate.pojo.UsertypeEmployee;
import com.opensymphony.xwork2.ActionSupport;
import java.util.ArrayList;
import java.util.List;
import org.apache.log4j.Logger;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;

@Action(value = "/select-loanappstat", results = {
    @Result(name = "success", location = "../fragments/loanappstat.jsp"),
    @Result(name = "error", location = "../error/messages.jsp")
})
public class ForGridLoanappStat extends ActionSupport {

    private static Logger logger = Logger.getLogger(ForGridLoanappStat.class);
    private List<String> colList;

    @Override
    public String execute() {
        try {
            colList = new ArrayList<String>();
            colList.add("preapproved");
            colList.add("pending");
        } catch (Exception ex) {
            Employees emps = (Employees) ServletActionContext.getRequest().getSession().getAttribute("employee");
            if (emps != null) {
                logger.fatal("(" + emps.getIdnumber() + "):" + ex.getLocalizedMessage(), ex);
            } else {
                logger.fatal(ex.getLocalizedMessage(), ex);
            }
            addActionError(ex.getLocalizedMessage());
            return ERROR;
        }
        return SUCCESS;
    }

    public List<String> getColList() {
        return colList;
    }
    
    
}
